package springcloud;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @describte:TODO
 * @program:spring-cloud-demo
 * @author:zhengdp
 * @create:2021-10-05 01:39:14
 **/
@RestController
@RequestMapping("/refresh")
@RefreshScope
public class RefreshController {

    @Value("${words}")
    private String words;
    @Value("${food}")
    private String food;

    @GetMapping("/words")
    public String getWords(){
        return words;
    }

    @GetMapping("/food")
    public String getFood(){
        return food;
    }
}
